package com.project.controller;

import com.project.bean.MangerBean;
import com.project.service.IManageService;
import com.project.vo.ResultVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.apache.shiro.crypto.hash.Md5Hash;

@RestController
public class managerController {
      @Autowired
       private IManageService service;
      @RequestMapping("manageLogin")
      public ResultVo login(String manager,String password){
            System.out.println(password);
            Md5Hash md5Hash = new Md5Hash(password);
            MangerBean mangerBean=service.login(manager,md5Hash.toHex());
            System.out.println(mangerBean);
            if(mangerBean!=null){
                  return ResultVo.ok(mangerBean);
            }else {
                  return ResultVo.fail("登录失败");
            }
            
      }
}
